<div class="panel-base panel-admin">
	<div>		
		<div class="panel-preview">			
			<img class="img-preview" />							
		</div>				
		<div id="tabs">
			<ul>
				<li><a href="#tabs-1">Banner</a></li>
				<li><a href="#tabs-2">Ads Code</a></li>			    
			</ul>
			<div id="tabs-1">
				<form id="frm-upload" action="<?php print base_url(); ?>admin/banner/add/submit-u" method="post" enctype="multipart/form-data">			
					<input type="file" name="fc" id="fc" style="display:none;" onchange="readURL(this, $('.img-preview'));" accept="image/png, image/jpg" />
					<div class="control-group row-fluid" id="group-anp">
						<span class="span2">สถานะใช้งาน</span>
						<div class="span8">
							<div class="switch switch-small switch-state" data-on="success" data-off="danger">	
								<input type="checkbox" name="ds"  />						
							</div>
						</div>
					</div>							
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">รูปภาพ</span>	
						<div class="span8">
							<div class="controls">
								<div class="input-append">
									<input type="text" id="img-path" class="input-large">
									<a class="btn" id="inv-fc" onclick="$('#fc').trigger('click');">Browse</a>
								</div>
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">ขนาดรูป</span>	
						<div class="span8">
							<div class="controls">
								<input type="text" name="dwidth" class="input-mini" /> x
								<input type="text" name="dheight" class="input-mini" /> pixel
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">URL</span>	
						<div class="span8">
							<div class="controls">
								<input type="text" name="durl" class="input-large" placeholder="http://www.example.com" />
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">ตำแหน่ง</span>	
						<div class="span8">
							<div class="controls">
								<?php print form_dropdown('dt', $banner_list_dd, null, 'id="dt"')?>
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">วันที่เริ่ม</span>	
						<div class="span8">
							<div class="controls">
								<input type="text" class="dtpicker span4" name="dps" value="<?php print date('Y-m-d'); ?>" />
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">วันที่สิ้นสุด</span>	
						<div class="span8">
							<div class="controls">
								<input type="text" class="dtpicker span4" name="dpe" />
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">จำนวนวันที่</span>	
						<div class="span8">
							<div class="controls">
								<span id="d-remain"></span>
							</div>													
						</div>				
					</div>					
					<div>									
						<a href="#modal-upload" role="button" data-toggle="modal" class="btn btn-primary" style="color:#fff;">บันทึกข้อมูล</a>
						<a role="button" class="btn">ยกเลิก</a>						
					</div>	
				</form>				
			</div>
			<div id="tabs-2">
				<form id="frm-code" action="<?php print base_url(); ?>admin/banner/add/submit-c" method="post" enctype="multipart/form-data">				
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">Code</span>	
						<div class="span8">
							<div class="controls">
								<textarea name="cb" id="cb" rows="2" style="resize:none; width:300px;"></textarea>
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">ตำแหน่ง</span>	
						<div class="span8">
							<div class="controls">
								<?php print form_dropdown('dt', $banner_list_dd, null, 'id="dt"')?>
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">วันที่เริ่ม</span>	
						<div class="span8">
							<div class="controls">
								<input type="text" class="dtpicker span4" name="dps" value="<?php print date('Y-m-d'); ?>" />
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">วันที่สิ้นสุด</span>	
						<div class="span8">
							<div class="controls">
								<input type="text" class="dtpicker span4" name="dpe" />
							</div>													
						</div>				
					</div>
					<div class="control-group row-fluid" id="group-anp">									
						<span class="span2">จำนวนวันที่</span>	
						<div class="span8">
							<div class="controls">
								<span id="d-remain"></span>
							</div>													
						</div>				
					</div>			
					<div>
						<a href="#modal-code" role="button" data-toggle="modal" class="btn btn-primary">บันทึกข้อมูล</a>
						<a role="button" class="btn" href="<?php print base_url(); ?>admin/banner">ยกเลิก</a>
					</div>					
				</form>					
			</div>			
		</div>				
	</div>	
</div>

<!-- Upload modal -->
<div id="modal-upload" class="modal hide fade" role="dialog" aria-hidden="true">
	<div class="modal-header">		
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h5>เพิ่มข้อมูล</h5>		
	</div>
	<div class="modal-body">					
		<p>ยืนยันการเพิ่มแบนเนอร์</p>		
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true">ยกเลิก</button>
		<button class="btn btn-primary" id="btn-upload-submit" onclick="document.getElementById('frm-upload').submit();">ตกลง</button>		
	</div>
</div>
<!-- Code modal -->
<div id="modal-code" class="modal hide fade" role="dialog" aria-hidden="true">
	<div class="modal-header">		
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h5>เพิ่มข้อมูล</h5>		
	</div>
	<div class="modal-body">					
		<p>ยืนยันการเพิ่ม Ads Code</p>		
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true">ยกเลิก</button>
		<button class="btn btn-primary" id="btn-code-submit" onclick="$('#frm-code').submit();">ตกลง</button>
	</div>
</div>

<script type="text/javascript">	
	$(function(){
		$('#tabs').tabs();		
		$('#fc').change(function(){
			$('#img-path').val($(this).val());
		});
		$('.dtpicker').datepicker({
			dateFormat	: 'yy-mm-dd'
		});		
	});
</script>

